package com.example.demo.service;

import com.example.demo.Repository.ArticleRepository;
import com.example.demo.entity.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService{

    @Autowired
    private ArticleRepository articleRepository;
    @Override
    public List<Article> getArticleList(){
        return articleRepository.findAll();
    }//列表查询

    @Override
    public Article findArticleById(long id){
        return articleRepository.findById(id);
    }//根据id查询
}
